﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="new.aspx.cs" Inherits="AnyOffice.general.sms._new" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>发送内部短信</title>
		<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		<script src="/aspnet_client/core/function.js"></script>
		<script Language="JavaScript">
function CheckForm()
{
   if(document.Form1.ToId.value=="")
   { alert("请添加收信人！");
     return (false);
   }

   if(document.Form1.txtContent.value=="")
   { alert("短信内容不能为空！");
     document.Form1.txtContent.focus();
     return (false);
   }
   
   /*
   if(document.Form1.Content.value.length>100)
   { alert("短信内容最多100个字！");
     return (false);
   }
   */
   
   document.Form1.submit();  
}

function alldept_switch()
{
	if(document.getElementById("AllDept").checked)
	{
		document.getElementById("ToId").value = "ALL_DEPT";
		document.getElementById("ToName").value = "全体成员";
	}
	else
	{
		document.getElementById("ToId").value = "";
		document.getElementById("ToName").value = "";
	}
}

function user_select2(toId, toName)
{
	if(document.getElementById("AllDept").checked)
	{
		document.getElementById("AllDept").checked = false;
		document.getElementById("ToId").value = "";
		document.getElementById("ToName").value = "";		
	}
	user_select(toId, toName);
}

function clear_double2(toId, toName)
{
	document.getElementById("AllDept").checked = false;
	clear_double(toId, toName);
}

function clear_sms()
{
  document.getElementById("txtContent").value="";
}

function CheckSend()
{
  if(event.keyCode==10)
  {
    CheckForm();       
  }
}
		</script>
	</HEAD>
	<body class="bodycolor" topmargin="5" style="padding-top:0;">
	  <div class="main_div">
		<form id="Form1" method="post" runat="server">
         
			<asp:Panel id="pnlMain" runat="server">
				<TABLE class="small" cellSpacing="0" cellPadding="3" width="100%" border="0">
					<TR>
						<TD class="tab_ti"><SPAN class="big3">
								发送内部短信</SPAN>
						</TD>
					</TR>
				</TABLE>
				<TABLE width="600" cellSpacing="0" cellPadding="0" border="0" class="tab_pub" align="center">
					<TR>
					    <td width="70" class="ta_bg">收信人</td>
						<TD class="ta_txt"><input id="ToId" type="hidden" name="ToId" runat="server">
						  <TEXTAREA class="BigStatic fl" id="ToName" name="ToName" rows="6" readOnly wrap="yes" cols="55"
								runat="server"></TEXTAREA><INPUT class="bnt_Add fl" style="width:50px; display:inline-table;" title="添加收信人" onClick="user_select2('ToId','ToName')" type="button"
								value="添加" name="button"><INPUT class="bnt_Del fl" style="width:50px; display:inline-table;" title="清空收信人" onClick="clear_double2('ToId','ToName')" type="button"
								value="清空" name="button">
								<BR><input id="AllDept" type="checkbox" name="AllDept" onClick="alldept_switch()">发送至全体成员					  </TD>
					</TR>
					<TR>
						<td class="ta_bg">短信内容</td>
						<TD class="ta_txt"><TEXTAREA class="BigInput fl" onKeyPress="CheckSend()" id="txtContent" name="Content" rows="8"
								wrap="on" cols="55" runat="server"></TEXTAREA><INPUT class="bnt_Del fl" style="width:50px; display:inline-table;" title="清空" onClick="clear_sms();" type="button"
								value="清空" name="button">
							<BR>按Ctrl+回车键发送消息						</TD>
					</TR>
					<TR align="center">
						<TD noWrap class="bnt_con" colSpan="2">
						<table width="140" cellpadding="0" cellspacing="0" border="0" style="border:none;">
						  <tr>
						    <td align="left" style="border:none;"><INPUT class="bnt02" style="width:70px; display:inline-table;" onClick="CheckForm();" type="button" value="发送短信"></td>
							<td align="right" style="border:none;"><INPUT class="bnt01" style="width:60px; display:inline-table;" onClick="location='new.aspx'" type="button" value="重填"></td>
						  </tr>
						</table>						</TD>
					</TR>
				</TABLE>
			</asp:Panel>
			<asp:Panel id="pnlLater" runat="server" Visible="False">
				<asp:Literal id="litMessage" runat="server"></asp:Literal>
				<BR>
				<BR>
				<DIV align="center">
						<table width="140" cellpadding="0" cellspacing="0" border="0" style="border:none;">
						  <tr>
						    <td align="left" style="border:none;"><INPUT class="bnt02" style="width:70px; display:inline-table;" onClick="location='new.aspx'" type="button" value="继续发短信" name="button1"></td>
							<td align="right" style="border:none;"><INPUT class="bnt01" style="width:60px; display:inline-table;" onClick="location='new.aspx'" type="button" value="返 回"></td>
						  </tr>
						</table>
				</DIV>
			</asp:Panel>
		</form>
		</div>
	</body>
</HTML>
